<?php
/*
+-----------------------------------------------------------------------------+
| $Id: *.php,v 1.* 2005/07/01 06:15:08 Bleakwind Exp $
| SnowStats
|         --- A Web Statistics Analysis for multiuser
| Copyright (c) 2003-2005 Weaverdream.com By Bleakwind
| http://www.weaverdream.com
+-----------------------------------------------------------------------------+
*/

include_once 'include/include.php';
check_ifview();
include_once 'include/header.php';
?>

<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#5E94DD" align="center">
  <tr bgcolor="#5E94DD">
    <td width="200" align="center" valign="top" class="left_bg">
      <?include_once 'include/menu.php';?>
	</td>
	<td width="560" bgcolor="#FFFFFF" valign="top">

<?php
$user               = $_SESSION['sess_select'];
$userdir            = $SETTING['dir_data'].$user;

$file_config        = $userdir."/".$SETTING['file_config'];
$file_ipsame        = $userdir."/".$SETTING['file_ipsame'];

$file_click         = $userdir."/".$SETTING['file_click'];

$file_totalmonth    = $userdir."/".$SETTING['file_totalmonth'];
$file_totalday      = $userdir."/".$SETTING['file_totalday'];
$file_totalhour     = $userdir."/".$SETTING['file_totalhour'];

$file_year          = $userdir."/".$SETTING['file_year'];
$file_month         = $userdir."/".$SETTING['file_month'];
$file_day           = $userdir."/".$SETTING['file_day'];
$file_hour          = $userdir."/".$SETTING['file_hour'];
   
$file_online        = $userdir."/".$SETTING['file_online'];
$file_visitor       = $userdir."/".$SETTING['file_visitor'];
   
$file_os            = $userdir."/".$SETTING['file_os'];
$file_browser       = $userdir."/".$SETTING['file_browser'];
$file_language      = $userdir."/".$SETTING['file_language'];
$file_colordepth    = $userdir."/".$SETTING['file_colordepth'];
$file_screensize    = $userdir."/".$SETTING['file_screensize'];
$file_timezone      = $userdir."/".$SETTING['file_timezone'];

$file_searchfrom    = $userdir."/".$SETTING['file_searchfrom'];
$file_searchkeyword = $userdir."/".$SETTING['file_searchkeyword'];

include $file_config;

if(empty($_GET['page']) || $_GET['page'] <= 0){$page = 1;}else{$page = (int)$_GET['page'];}
$perpage            = 20;// How many record Paginal

if(empty($_GET['act'])){ header("location:prompt.php"); }
switch($_GET['act']){

// About visitor
case "visitor":

$list         = read_visitor($file_visitor);
$total_record = count($list['time']);
$record_first = $perpage * ($page - 1) + 1;// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_last_visitor_placedir'];?> &raquo; <?php echo sprintf($LANGUAGE['collect_last_visitor_place'],CONFIG_LAST_VISITOR);?></td></tr></table>
<br>

<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr bgcolor="#5E94DD"><td align="center" class="right_title" colspan="4"><?php echo sprintf($LANGUAGE['collect_last_visitor_title'],CONFIG_LAST_VISITOR);?></td></tr>
<tr>
  <td width="15%" nowrap class="right_subject"><?php echo $LANGUAGE['collect_last_visitor_date_time'];?></td>
  <td width="25%" class="right_title2"><?php echo $LANGUAGE['collect_last_visitor_ip_place'];?></td>
  <td width="30%" class="right_title2"><?php echo $LANGUAGE['collect_last_visitor_href'];?></td>
  <td width="30%" class="right_title2"><?php echo $LANGUAGE['collect_last_visitor_referrer'];?></td>
</tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now <= $total_record){
       $time  = $list['time'][$record_now];
       $date1 = date('Y-m-d',$time);
       $date2 = date('H:i:s',$time);
       echo "<tr bgcolor=#EBE9ED align=center>";
       echo "<td bgcolor=#5E94DD nowrap class='right_subject'>".$date1."<br>".$date2."</td>";
       echo "<td><a href='http://www.whois.sc/".$list['ip'][$record_now]."' target='_blank'>".$list['ip'][$record_now]."</a><br>".$list['place'][$record_now]."</td>";
       if( trim($list['href'][$record_now]) == "Unknown"){
           echo "<td align='left' title='".$list['href'][$record_now]."' class='webaddress'>".bite_str($list['href'][$record_now],1,26)."</a></td>";
       }else{
           echo "<td align='left'><a href='".$list['href'][$record_now]."' target='_blank' title='".$list['href'][$record_now]."' class='webaddress'>".bite_str($list['href'][$record_now],1,26)."</a></td>";
       }
       if( trim($list['referrer'][$record_now]) == "Browser Address" || trim($list['referrer'][$record_now]) == "Unknown" ){
           echo "<td align='left' title='".$list['referrer'][$record_now]."' class='webaddress'>".bite_str($list['referrer'][$record_now],1,26)."</a></td>";
       }else{
           echo "<td align='left'><a href='".$list['referrer'][$record_now]."' target='_blank' title='".$list['referrer'][$record_now]."' class='webaddress'>".bite_str($list['referrer'][$record_now],1,26)."</a></td>";
       }
       echo "</tr>";
   }
}
echo "<tr align='right' bgcolor='#5E94DD'><td height='20' colspan='4'>";
pagination("collect.php?act=visitor&",$total_record,$perpage);
echo "</td></tr></table>";

break;

// About online
case "online":

$list         = read_online($file_online,CONFIG_ONLINE_LONG,$TIMENOW['time']);
$total_record = count($list['time']);
$record_first = $perpage * ($page - 1) + 1;// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_online_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_online_place'];?></td></tr></table>
<br>

<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr bgcolor="#5E94DD"><td align="center" class="right_title" colspan="4"><?php echo $LANGUAGE['collect_online_title'];?></td></tr>
<tr>
  <td width="15%" nowrap class="right_subject"><?php echo $LANGUAGE['collect_online_date_time'];?></td>
  <td width="25%" class="right_title2"><?php echo $LANGUAGE['collect_online_ip_place'];?></td>
  <td width="30%" class="right_title2"><?php echo $LANGUAGE['collect_online_href'];?></td>
  <td width="30%" class="right_title2"><?php echo $LANGUAGE['collect_online_referrer'];?></td>
</tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now <= $total_record){
       $time  = $list['time'][$record_now];
       $date1 = date('Y-m-d',$time);
       $date2 = date('H:i:s',$time);
       echo "<tr bgcolor=#EBE9ED align=center>";
       echo "<td bgcolor=#5E94DD nowrap class='right_subject'>".$date1."<br>".$date2."</td>";
       echo "<td><a href='http://www.whois.sc/".$list['ip'][$record_now]."' target='_blank'>".$list['ip'][$record_now]."</a><br>".$list['place'][$record_now]."</td>";
       if( trim($list['href'][$record_now]) == "Unknown"){
           echo "<td align='left' title='".$list['href'][$record_now]."' class='webaddress'>".bite_str($list['href'][$record_now],1,26)."</a></td>";
       }else{
           echo "<td align='left'><a href='".$list['href'][$record_now]."' target='_blank' title='".$list['href'][$record_now]."' class='webaddress'>".bite_str($list['href'][$record_now],1,26)."</a></td>";
       }
       if( trim($list['referrer'][$record_now]) == "Browser Address" || trim($list['referrer'][$record_now]) == "Unknown"){
           echo "<td align='left' title='".$list['referrer'][$record_now]."' class='webaddress'>".bite_str($list['referrer'][$record_now],1,26)."</a></td>";
       }else{
           echo "<td align='left'><a href='".$list['referrer'][$record_now]."' target='_blank' title='".$list['referrer'][$record_now]."' class='webaddress'>".bite_str($list['referrer'][$record_now],1,26)."</a></td>";
       }
       echo "</tr>";
   }
}
echo "<tr align='right' bgcolor='#5E94DD'><td height='20' colspan='4'>";
pagination("collect.php?act=visitor&",$total_record,$perpage);
echo "</td></tr></table>";

break;

// About year
case "year":

$list = read_list($file_year,$array_year);
$sum  = read_sum($file_year,$array_year);
$max  = read_max($file_year,$array_year);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_year_placedir'];?> &raquo; <?php echo sprintf($LANGUAGE['collect_year_place'],$SETTING['howyear']);?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo sprintf($LANGUAGE['collect_year_pic_title'],$SETTING['howyear']);?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_year);$i++){
   $now_key    = date("Y",mktime($TIMENOW['hour'],0,0,$TIMENOW['month'],$TIMENOW['day'],$TIMENOW['year']-9+$i));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;'><img src=images/pillar_a1.gif width=15 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=15 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_year);$i++){
   $now_key = $array_year[$i];
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
</td></tr>
<tr><td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo sprintf($LANGUAGE['collect_year_data_title'],$SETTING['howyear']);?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_year_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_year);$i++){
   $now_key    = trim($array_year[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>


<?php
break;

// About month
case "month":

$list = read_list($file_month,$array_month);
$sum  = read_sum($file_month,$array_month);
$max  = read_max($file_month,$array_month);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_month_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_month_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo $LANGUAGE['collect_month_pic_title'];?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_month);$i++){
   $now_key    = date("Y-m",mktime($TIMENOW['hour'],0,0,$TIMENOW['month']-11+$i,$TIMENOW['day'],$TIMENOW['year']));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   $end_style  = substr($array_month[$i],4,2) == 12 ? "border-right-width: 1px;border-right-style: solid;border-right-color: #FF0000;" : "border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;";
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='".$end_style."'><img src=images/pillar_a1.gif width=15 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=15 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_month);$i++){
   $now_key = substr($array_month[$i],4,2);
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
</td></tr>
<tr><td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo $LANGUAGE['collect_month_data_title'];?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_month_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_month);$i++){
   $now_key    = date("Y-m",mktime($TIMENOW['hour'],$TIMENOW['minute'],$TIMENOW['second'],$TIMENOW['month']-count($array_month)+$i+1,$TIMENOW['day'],$TIMENOW['year']));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>

<?php
break;

// About day
case "day":

$list = read_list($file_day,$array_day);
$sum  = read_sum($file_day,$array_day);
$max  = read_max($file_day,$array_day);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_day_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_day_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo $LANGUAGE['collect_day_pic_title'];?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_day);$i++){
   $now_key    = date("Y-m-d",mktime($TIMENOW['hour'],0,0,$TIMENOW['month'],$TIMENOW['day']-30+$i,$TIMENOW['year']));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   $end_style  = substr($array_day[$i],6,2) == $number_lastmonth ? "border-right-width: 1px;border-right-style: solid;border-right-color: #FF0000;" : "border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;";
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='".$end_style."'><img src=images/pillar_a1.gif width=6 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=6 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_day);$i++){
   $now_key = substr($array_day[$i],6,2);
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
</td></tr>
<tr><td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo $LANGUAGE['collect_day_data_title'];?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_day_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_day);$i++){
   $now_key    = date("Y-m-d",mktime($TIMENOW['hour'],$TIMENOW['minute'],$TIMENOW['second'],$TIMENOW['month'],$TIMENOW['day']-count($array_day)+$i+1,$TIMENOW['year']));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>
<?php
break;

// About hour
case "hour":

$list = read_list($file_hour,$array_hour);
$sum  = read_sum($file_hour,$array_hour);
$max  = read_max($file_hour,$array_hour);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_hour_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_hour_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo $LANGUAGE['collect_hour_pic_title'];?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_hour);$i++){
   $now_key    = date("Y-m-d H",mktime($TIMENOW['hour']-23+$i,0,0,$TIMENOW['month'],$TIMENOW['day'],$TIMENOW['year']));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   $end_style  = substr($array_hour[$i],8,2) == 23 ? "border-right-width: 1px;border-right-style: solid;border-right-color: #FF0000;" : "border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;";
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='".$end_style."'><img src=images/pillar_a1.gif width=6 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=6 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_hour);$i++){
   $now_key = substr($array_hour[$i],8,2);
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
</td></tr>
<tr><td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo $LANGUAGE['collect_hour_data_title'];?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_hour_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_hour);$i++){
   $now_key    = date("Y-m-d H",mktime($TIMENOW['hour']-count($array_hour)+$i+1,$TIMENOW['minute'],$TIMENOW['second'],$TIMENOW['month'],$TIMENOW['day'],$TIMENOW['year']));
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>
<?php
break;

// About totalmonth
case "totalmonth":

$list = read_list($file_totalmonth,$array_month_virgin);
$sum  = read_sum($file_totalmonth,$array_month_virgin);
$max  = read_max($file_totalmonth,$array_month_virgin);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_totalmonth_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_totalmonth_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo $LANGUAGE['collect_totalmonth_pic_title'];?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_month_virgin);$i++){
   $now_key    = trim($array_month_virgin[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;'><img src=images/pillar_a1.gif width=15 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=15 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_month_virgin);$i++){
   $now_key = $array_month_virgin[$i];
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
    </td>
  </tr>
  <tr>
    <td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo $LANGUAGE['collect_totalmonth_data_title'];?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_totalmonth_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_month_virgin);$i++){
   $now_key    = trim($array_month_virgin[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>
<?php
break;

// About totalday
case "totalday":

$list = read_list($file_totalday,$array_day_virgin);
$sum  = read_sum($file_totalday,$array_day_virgin);
$max  = read_max($file_totalday,$array_day_virgin);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_totalday_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_totalday_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo $LANGUAGE['collect_totalday_pic_title'];?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_day_virgin);$i++){
   $now_key    = trim($array_day_virgin[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;'><img src=images/pillar_a1.gif width=6 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=6 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_day_virgin);$i++){
   $now_key = $array_day_virgin[$i];
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
</td></tr>
<tr><td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo $LANGUAGE['collect_totalday_data_title'];?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_totalday_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_day_virgin);$i++){
   $now_key    = trim($array_day_virgin[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>
<?php
break;

// About totalhour
case "totalhour":

$list = read_list($file_totalhour,$array_hour_virgin);
$sum  = read_sum($file_totalhour,$array_hour_virgin);
$max  = read_max($file_totalhour,$array_hour_virgin);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_totalhour_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_totalhour_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td height="20" align="center" class="right_title"><?php echo $LANGUAGE['collect_totalhour_pic_title'];?></td></tr>
<tr bgcolor="#B9CFF0" align="center"><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="10%">
      <table width="95%" height="110" border="0" cellpadding="0" cellspacing="0">
        <tr><td align="right" valign="bottom" height="16" class="label_number"><?php echo $max['pv'];?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.75);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.5);?></td></tr>
        <tr><td align="right" valign="bottom" height="25" class="label_number"><?php echo floor($max['pv']*0.25);?></td></tr>
        <tr><td align="right" valign="bottom" height="19" class="label_number">0</td></tr>
      </table>
    </td>
<?php
for($i=0;$i<count($array_hour_virgin);$i++){
   $now_key    = trim($array_hour_virgin[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_height  = ceil($ip/$max['pv']*100);
   $pv_height  = ceil($pv/$max['pv']*100);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<td bgcolor='#EBE9ED' background='images/bg_dotted.gif'><table width='100%' height='110' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' style='border-right-width: 1px;border-right-style: dotted;border-right-color: #CCCCCC;'><img src=images/pillar_a1.gif width=6 height=".$ip_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'><img src=images/pillar_a2.gif width=6 height=".$pv_height." border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
}
?>
  </tr>
  <tr align="center">
    <td width="10%"></td>
<?php
for($i=0;$i<count($array_hour_virgin);$i++){
   $now_key = $array_hour_virgin[$i];
   echo "<td class='label_number'>".$now_key."</td>";
}
?>   
  </tr>
</table>
</td></tr>
<tr><td bgcolor="#B9CFF0" align="right"><img src="images/pillar_a1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_a2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
<tr><td align="center" class="right_title" colspan="5"><?php echo $LANGUAGE['collect_totalhour_data_title'];?></td></tr>
<tr>
  <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_totalhour_data_subject'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
  <td width="40%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
</tr>
<tr>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
  <td width="20%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
</tr>
<?php
for($i=0;$i<count($array_hour_virgin);$i++){
   $now_key    = trim($array_hour_virgin[$i]);
   $ip         = trim($list['ip'][$i]);
   $pv         = trim($list['pv'][$i]);
   $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
   $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
   echo "<tr bgcolor=#EBE9ED align=center>";
   echo "<td bgcolor=#5E94DD class='right_subject'>".$now_key."</td>";
   echo "<td>".$ip."</td>";
   echo "<td>".$ip_percent."%</td>";
   echo "<td>".$pv."</td>";
   echo "<td>".$pv_percent."%</td>";
   echo "</tr>";
}
?>
</table>
<?php
break;

// About os
case "os":

$array        = read_keyarray($file_os,4);
$list         = read_list($file_os,$array);
$sum          = read_sum($file_os,$array);
$max          = read_max($file_os,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_os_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_os_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_os_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_os_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'>".$now_key."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=os&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About browser
case "browser":

$array        = read_keyarray($file_browser,4);
$list         = read_list($file_browser,$array);
$sum          = read_sum($file_browser,$array);
$max          = read_max($file_browser,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_browser_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_browser_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_browser_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_browser_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'>".$now_key."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=browser&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About language
case "language":

$array        = read_keyarray($file_language,4);
$list         = read_list($file_language,$array);
$sum          = read_sum($file_language,$array);
$max          = read_max($file_language,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_language_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_language_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_language_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_language_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'>".$now_key."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=language&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About colordepth
case "colordepth":

$array        = read_keyarray($file_colordepth,4);
$list         = read_list($file_colordepth,$array);
$sum          = read_sum($file_colordepth,$array);
$max          = read_max($file_colordepth,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_colordepth_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_colordepth_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_colordepth_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_colordepth_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'>".$now_key."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=colordepth&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About screensize
case "screensize":

$array        = read_keyarray($file_screensize,4);
$list         = read_list($file_screensize,$array);
$sum          = read_sum($file_screensize,$array);
$max          = read_max($file_screensize,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_screensize_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_screensize_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_screensize_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_screensize_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'>".$now_key."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=screensize&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About timezone
case "timezone":

$array        = read_keyarray($file_timezone,4);
$list         = read_list($file_timezone,$array);
$sum          = read_sum($file_timezone,$array);
$max          = read_max($file_timezone,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_timezone_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_timezone_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_timezone_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_timezone_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'>".$now_key."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=timezone&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About search_from
case "searchfrom":

$array        = read_keyarray($file_searchfrom,4);
$list         = read_list($file_searchfrom,$array);
$sum          = read_sum($file_searchfrom,$array);
$max          = read_max($file_searchfrom,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_searchfrom_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_searchfrom_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_searchfrom_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_searchfrom_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' class='right_subject'><a href='".$SEARCHLIST[$now_key]['url']."'  title='".$SEARCHLIST[$now_key]['url']."' target='_blank' class='link2'>".$now_key."</a></td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv." ".$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=searchfrom&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

// About search_keyword
case "searchkeyword":

$array        = read_keyarray($file_searchkeyword,4);
$list         = read_list($file_searchkeyword,$array);
$sum          = read_sum($file_searchkeyword,$array);
$max          = read_max($file_searchkeyword,$array);
$total_record = count($array);
$record_first = $perpage * ($page - 1);// First record of current page
?>
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#EBE9ED"><tr><td><img src="images/arrowright.gif" border=0 align="absmiddle"> <a href="index.php" target="_self"><font style="color:#000000;"><?php echo CONFIG_WEBSITE;?></font></a> &raquo; <?php echo $LANGUAGE['collect_searchkeyword_placedir'];?> &raquo; <?php echo $LANGUAGE['collect_searchkeyword_place'];?></td></tr></table>
<br>
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
  <tr>
    <td height="20" align="center" colspan="6" class="right_title"><?php echo $LANGUAGE['collect_searchkeyword_title'];?></td>
  </tr>
  <tr>
    <td width="20%" rowspan="2" class="right_subject"><?php echo $LANGUAGE['collect_searchkeyword_subject'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_ip'];?></td>
    <td width="30%" height="20" colspan="2" class="right_title2"><?php echo $LANGUAGE['collect_data_pv'];?></td>
    <td width="20%" rowspan="2" class="right_title2"><?php echo $LANGUAGE['collect_pic_show'];?></td>
  </tr>
  <tr>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_number'];?></td>
    <td width="15%" height="20" class="right_title2"><?php echo $LANGUAGE['collect_data_percent'];?></td>
  </tr>
<?php
for($i=0;$i<$perpage;$i++){
   $record_now = $record_first+$i;
   if($record_now < $total_record){
       $now_key    = trim(str_decode($array[$record_now]));
       $ip         = trim($list['ip'][$record_now]);
       $pv         = trim($list['pv'][$record_now]);
       $ip_height  = ceil($ip/$max['pv']*100);
       $pv_height  = ceil($pv/$max['pv']*100);
       $ip_percent = sprintf("%01.2f",($ip/$sum['ip']*100));
       $pv_percent = sprintf("%01.2f",($pv/$sum['pv']*100));
       echo "<tr align='center' bgcolor='#EBE9ED'>";
       echo "<td height='20' title='".$now_key."' class='right_subject'>".bite_str($now_key,1,12)."</td>";
       echo "<td height='20'>".$ip."</td>";
       echo "<td height='20'>".$ip_percent."%</td>";
       echo "<td height='20'>".$pv."</td>";
       echo "<td height='20'>".$pv_percent."%</td>";
       echo "<td height='20' align='left'><table border=0 cellpadding=0 cellspacing=0><tr><td align='left'><img src=images/pillar_b1.gif width=".$ip_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_ip'].$ip.$LANGUAGE['collect_pic_percent'].$ip_percent."%'></td></tr><tr><td align='left'><img src=images/pillar_b2.gif width=".$pv_height." height=8 border=0 title='".$now_key." &raquo; ".$LANGUAGE['collect_pic_pv'].$pv.$LANGUAGE['collect_pic_percent'].$pv_percent."%'></td></tr></table></td>";
       echo "</tr>";
   }
}
?>
  <tr align="right" bgcolor="#5E94DD">
    <td height="20" colspan="6">
<?php
pagination("collect.php?act=searchkeyword&",$total_record,$perpage);
?>
    </td>
  </tr>
  <tr>
    <td height="20" bgcolor="#B9CFF0" colspan="6" align="right"><img src="images/pillar_b1.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_ip_pic'];?> <img src="images/pillar_b2.gif" width="15" height="10" border="0" align="absmiddle"> <?php echo $LANGUAGE['collect_pic_pv_pic'];?>&nbsp;</td>
  </tr>
</table>
<?php
break;

default:
   header("location:prompt.php");
break;

}//swich

echo "<br></td></tr></table>";
include_once 'include/footer.php';
?>